home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import posixpath
- from checkbox.lib.cache import cache
- from checkbox.properties import String
- from checkbox.registries.command import CommandRegistry
-
- class DmiRegistry(CommandRegistry):
- '''Registry for dmi information.'''
- command = String(default = 'grep -r . /sys/class/dmi/id/ 2>/dev/null || true')
-
- def items(self):
- items = []
- for line in str(self).split('\n'):
- if not line:
- continue
-
- (path, value) = line.split(':', 1)
- key = posixpath.basename(path)
- items.append((key, value))
-
- return items
-
- items = cache(items)
-
- factory = DmiRegistry
-